require 'open-uri'
require 'rubygems'
require 'hpricot'

File.open("../data/places.tsv", "r").readlines.each do |line|
  woeid = line.split(/\t/).first
  url = "http://weather.yahooapis.com/forecastrss?w=" + woeid + "&u=c"
  puts "fetch from " + url
  data = Hpricot(open(url))
  File.new("../data/#{woeid}.xml", "w") << data
end